package tongkeyon.behavior.iterators;

/**
 * @Author: keyon <tongkeyon@163.com>
 * @Date: 2020/2/25 15:03
 * @Version 1.0
 */
public class Main {
    public static void main(String[] args) {
        Basket basket = new Basket();
        basket.add(new Fruit("哈密瓜",1.00));
        basket.add(new Fruit("苹果",5.00));
        basket.add(new Fruit("西红柿",9.00));
        Iterator iterate = basket.iterate();
        while (iterate.hasNext()){
            Fruit fuit = (Fruit) iterate.next();
            System.out.println(fuit);
        }
    }
}
